package com.itheima.a08threadmethod5;

public class ThreadDemo {

    /**
     * 插入线程
     *
     * 需求就是让土豆线程插入到 main 线程之前 -- 即土豆线程执行完了才能执行 main 线程
     * @param args
     */
    public static void main(String[] args) throws InterruptedException {
        MyThread myThread = new MyThread();

        myThread.setName("土豆");

        myThread.start();

        //插入到main之前
        myThread.join();

        //main线程
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + " @ " + i );
        }
    }
}
